# 准备
# 检查是否安装 mysql
yum list installed | grep mysql
# 卸载 mysql 及其依赖
yum -y remove mysql-libs.x86_64
# 检查是否安装 mysql 社区
yum repolist enabled | grep "mysql.*-community.*"
# 添加 mysql 社区
yum localinstall -y [mysql80-community-release-el7-3.noarch.rpm]

# 安装
# 安装 mysql
yum install -y mysql-community-server
# 启动 mysql
systemctl start mysqld
# 查看 mysql 服务状态
systemctl status mysqld